package cn.edu.besti.cs1723.DZX2304;



public class Searchingtest {
    public static void main(String[] args) {
    Integer[] a={10,2,8,19,16,18,20,51,};//被查找的数组
       Integer []a1={2,8,10,16,18,19,20,51};
        Searching b=new Searching();


        System.out.println("线性查找查找50的结果：" + Searching.linearSearch(a,0,7,50));
        System.out.println("线性查找查找2的结果："+Searching.linearSearch(a,0,7,2));
        System.out.println("二分查找50的结果：" + b.BinarySearch1(a1,50,7));
        System.out.println("二分查找2的结果：" + b.BinarySearch1(a1,2,7));
       System.out.println("插值查找能否找到50：" + b.InterpolationSearch(a1, 50));
        System.out.println("插值查找能否找到2：" + b.InterpolationSearch(a1,2));
        System.out.println("斐波那契查找能否找到50：" + Searching.FibonacciSearch(a1,0,11, 50));
        System.out.println("斐波那契查找能否找到2：" + Searching.FibonacciSearch(a1,0,11, 2));
        System.out.println("二叉查找树查找能否找到50：" + b.BinarySearchTreeSearch(a,0,7,50));
        System.out.println("二叉查找树查找能否找到2：" + b.BinarySearchTreeSearch(a,0,7,2));
        System.out.println("分块查找能否找到50：" + Searching.partitionSearch(a,0,7,50));
        System.out.println("分块查找能否找到2：" + Searching.partitionSearch(a,0,7,2));
        System.out.println("哈希表查找50的结果" +b.Hashsearching(a,50));
        System.out.println("哈希表查找2的结果"+b.Hashsearching(a,2));
    }}
